<template>
  <div class="step-container">
    <div class="step-title">3.设置印章</div>
    <div class="step-content">
      <Form :model="generateData" :label-width="125">
        <Row>
          <Col span="18">
            <FormItem label="章名称">
              <Input v-model="generateData.name" clearable></Input>
            </FormItem>
          </Col>
        </Row>
        <Row v-if="orgShow">
          <Col span="18">
            <FormItem label="机构名称">
              <Select v-model="generateData.orgId" filterable clearable>
                <Option
                  v-for="item in organizeList"
                  :value="item.id"
                  :key="item.id"
                >{{ item.orgName }}</Option>
              </Select>
            </FormItem>
          </Col>
        </Row>
        <FormItem label="图片">
          <!-- <Modal v-model="showImg" title="查看图片" @on-cancel="showImg = false">
            <img :src="item.url" width="100%" height="100%">
            <div slot="footer">
              <Button type="primary" @click="showImg = false">确定</Button>
            </div>
          </Modal>-->
          <template v-if="uploaded && generateData.cover !== ''">
            <img :src="SERVER_HOST + generateData.cover" class="seal-img">
            <!-- <div class="admin-upload-list-cover">
              <Icon type="ios-eye-outline" @click.native="showImg = true"></Icon>
              <Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
            </div>-->
          </template>
          <template v-else>
            <Spin fix v-if="uploaded && generateData.cover === ''">
              <Icon type="load-c" size="18" class="demo-spin-icon-load"></Icon>
            </Spin>
          </template>
          <Upload
            ref="upload"
            name="file"
            :action="fileUploadUrl"
            :format="['jpg', 'png', 'jpeg', 'gif', 'bmp', 'svg']"
            :max-size="2048"
            :on-exceeded-size="handleMaxSize"
            :on-format-error="handleFormatError"
            :on-success="handleSuccess"
            type="drag"
            :multiple="false"
            :show-upload-list="false"
            style="display: inline-block;width:58px;"
          >
            <div style="width: 58px;height:58px;line-height: 58px;">
              <Icon type="camera" size="20"></Icon>
            </div>
          </Upload>
        </FormItem>
      </Form>
    </div>
  </div>
</template>

<script src="./sealSetting.js"></script>
<style lang="less" src="./sealSetting.less"></style>